import {generateDoc, generateDocVip,getDocList,getDoc} from "@/api/doc/index";

const doc = {
    mutations: {

    },

    actions: {
        //律师入驻
        GenerateDoc({ commit }, data) {
            return new Promise((resolve, reject) => {
                generateDoc(data).then(res => {
                    //将res转换为string对象
                    resolve(res)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        //文书生成
        GenerateDocVip({ commit }, {id,orderNumber}) {
            return new Promise((resolve, reject) => {
                generateDocVip({id,orderNumber}).then(res => {
                    resolve(res)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        GetDocList({ commit }, data) {
            return new Promise((resolve, reject) => {
                getDocList(data).then(res => {
                    resolve(res)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        GetDoc({ commit }, id) {
            return new Promise((resolve, reject) => {
                getDoc(id).then(res => {
                    resolve(res)
                }).catch(error => {
                    reject(error)
                })
            })
        }

    }
}

export default doc;